@extends('home.layout.base')
<link rel="stylesheet" href="{{URL::asset('./css/hrmy/public.css')}}">
<link rel="stylesheet" href="{{URL::asset('./css/suppliermy/store.css')}}">
<link rel="stylesheet" href="{{URL::asset('./css/hrmy/info.css')}}">

@section('content')
<div class="mainHrContent" id="hrStore">
    <div class="storelistTitle">
        <span class="storelistTitle_left">
            <span>
                <img src="{{URL::asset('./img/icon/home.png')}}">
            </span>
            <span><a href="{{route('home.index.index') }}">首页</a> >
                <a href="{{route('home.suppliermy.supplierIndex') }}">供应商中心</a>
                > 店铺管理中心
            </span>
        </span>
        <span class="storelistTitle_right">
            <span>找不到合适的供应商？发个需求试试？</span>
            <button @click="window.location.href ='{{ route('home.demand.demandAdd')}}'">免费发布需求</button>
        </span>
    </div>
    <div class="hrContent">
        @include('home.suppliermy.menu')
        <div class="basicInfo" id="hrStores">
            <div class="unstore" v-if="false">
                <p>
                    <img src="{{URL::asset('./img/icon/unstore.png')}}">
                    您还未创建店铺，请创建店铺吧。
                </p>

                <button>
                    <a href="{{route('home.suppliermy.supplierStoreEdit') }}">创建店铺</a>
                </button>
            </div>
            <div class="basicInfo_title">
                <span></span>
                店铺管理中心
                <button><a :href="'{{route('home.suppliermy.supplierStoreEdit') }}?id='+storeData.id">修改</a></button>
            </div>
            <div class="userDetails">
                <p style="align-items:end">
                    <span class="details_title">LOGO：</span>
                    <img :src="storeData.logo">
                </p>
                <p>
                    <span class="details_title">店铺名称：</span>
                    @{{storeData.store_name}}
                </p>
                <p>
                    <span class="details_title">公司地址：</span>
                    @{{storeData.area_info}}
                </p>
                <p>
                    <span class="details_title">擅长领域：</span>
                    <button v-for="(item,index) in storeData.cate_id" v-if="index<5">@{{item.name}}</button>
                </p>
                <p>
                    <span class="details_title">服务区域：</span>
                    @{{storeData.service_area_name}}
                </p>
                <p>
                    <span class="details_title">服务时间：</span>
                    @{{storeData.workingtime[0]}}
                </p>
                <p style="align-items:baseline">
                    <span class="details_title">公司简介：</span>
                    <span style="width: 607px;">
                        @{{storeData.description}}
                    </span>
                </p>
                <p style="align-items:end">
                    <span class="details_title">图片展示：</span>
                    <el-carousel style="width: 550px;" :interval="4000" type="card" height="180px">
                        <el-carousel-item v-for="(item,index) in storeData.image" v-if="index<6"  :key="item">
                            <img style="width:100%;height:100%" :src="item.url">
                        </el-carousel-item>
                    </el-carousel>
                </p>
                <p>
                    <span class="details_title">服务内容：</span>
                    <button v-for="item in storeData.services">@{{item.title}}</button>
                </p>
                <p style="align-items:baseline">
                    <span class="details_title">案例展示：</span>
                    <span style="width: 550px;display: flex; flex-direction: column;">
                        <span v-for="(item,index) in storeData.cases">@{{index+1}}、@{{item.title}}</span>
                    </span>
                </p>
                <p style="align-items:end">
                    <span class="details_title">合作伙伴：</span>
                    <el-carousel style="width: 550px;" :interval="4000" type="card" height="180px">
                        <el-carousel-item v-for="(item,index) in storeData.partners" v-if="index<6" :key="item">
                            <img style="width:100%;height:100%" :src="item.url">
                        </el-carousel-item>
                    </el-carousel>
                </p>
            </div>
        </div>
    </div>
</div>
@endsection
@section('compontentScipts')
<script>
    $(() => {
        let hrStore = new Vue({
            el: '#hrStores',
            data: () => {
                return {
                    storeData: {}
                }
            },
            created() {
                this.getStore();
            },
            mounted() {},
            methods: {
                getStore() {
                    let data = {}
                    apiAjax("{{ route('home.user.supplierStoreApi')}}", 'get', data, (res) => {
                        if (res.code == 0) {
                            this.storeData = res.data;
                            this.storeData.image = JSON.parse(res.data.image);
                            this.storeData.partners = JSON.parse(res.data.partners);

                        } else {
                            this.$message({
                                message: res.msg,
                                type: 'warning'
                            });
                        }
                    }, (erro) => {

                    });
                },
            }
        })
    })
</script>
@endsection